<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxDao/QxSqlQueryBuilder.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_qx_sql_query_builder_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">QxSqlQueryBuilder.h</div>  </div>
</div>
<div class="contents">
<a href="_qx_sql_query_builder_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _QX_SQL_QUERY_BUILDER_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _QX_SQL_QUERY_BUILDER_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;boost/static_assert.hpp&gt;</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;<a class="code" href="_ix_sql_query_builder_8h.html" title="Common interface to build SQL queries to communicate with database.">QxDao/IxSqlQueryBuilder.h</a>&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;<a class="code" href="_qx_sql_query_helper_8h.html">QxDao/QxSqlQueryHelper.h</a>&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;<a class="code" href="_qx_class_8h.html" title="Concrete class registered into QxOrm context.">QxRegister/QxClass.h</a>&gt;</span>
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;<a class="code" href="remove__attr_8h.html" title="qx::trait::remove_attr&lt;T&gt;::type : return a type without pointer, const, reference and/or volatile att...">QxTraits/remove_attr.h</a>&gt;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &lt;<a class="code" href="remove__smart__ptr_8h.html" title="qx::trait::remove_smart_ptr&lt;T&gt;::type : return a type without smart-pointer attribute from boost...">QxTraits/remove_smart_ptr.h</a>&gt;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;<a class="code" href="is__qx__registered_8h.html" title="qx::trait::is_qx_registered&lt;T&gt;::value : return true if T is registered into QxOrm context to provide ...">QxTraits/is_qx_registered.h</a>&gt;</span>
<a name="l00056"></a>00056 
<a name="l00057"></a><a class="code" href="_qx_sql_query_builder_8h.html#a5239230e67090cd5fc5a689a0d72038a">00057</a> <span class="preprocessor">#define QX_SQL_ERR_NO_DATA_MEMBER_REGISTERED    &quot;&#39;QxSqlQueryBuilder&lt;T&gt;&#39; error : &#39;qx::register_class()&#39; not called or no data member registered&quot;</span>
<a name="l00058"></a><a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define QX_SQL_ERR_NO_ID_REGISTERED             &quot;&#39;QxSqlQueryBuilder&lt;T&gt;&#39; error : no id registered&quot;</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a><a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">00060</a> <span class="preprocessor">#define QX_SQL_BUILDER_INIT_FCT(oper) \</span>
<a name="l00061"></a>00061 <span class="preprocessor">QString key = QxClass&lt;type_sql&gt;::getSingleton()-&gt;getKey() + oper; \</span>
<a name="l00062"></a>00062 <span class="preprocessor">QString sql = IxSqlQueryBuilder::m_lstSqlQuery.value(key); \</span>
<a name="l00063"></a>00063 <span class="preprocessor">if (! sql.isEmpty()) { this-&gt;setSqlQuery(sql); return (* this); }</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a><a class="code" href="_qx_sql_query_builder_8h.html#a0842b161dcbe9aa9604465550c33602f">00065</a> <span class="preprocessor">#define QX_SQL_BUILDER_INIT_FCT_WITH_RELATION(oper) \</span>
<a name="l00066"></a>00066 <span class="preprocessor">QString key = QxClass&lt;type_sql&gt;::getSingleton()-&gt;getKey() + this-&gt;m_sHashRelation + oper; \</span>
<a name="l00067"></a>00067 <span class="preprocessor">QString sql = IxSqlQueryBuilder::m_lstSqlQuery.value(key); \</span>
<a name="l00068"></a>00068 <span class="preprocessor">if (! sql.isEmpty()) { this-&gt;setSqlQuery(sql); this-&gt;m_lstSqlQueryAlias = IxSqlQueryBuilder::m_lstSqlAlias.value(key); return (* this); }</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span>
<a name="l00070"></a>00070 <span class="keyword">namespace </span>qx {
<a name="l00071"></a>00071 
<a name="l00076"></a>00076 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00077"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html">00077</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a>
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="keyword">private</span>:
<a name="l00081"></a>00081 
<a name="l00082"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#aa8e28a6f126c5d8ef8f5f32024b1a97b">00082</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1remove__attr.html#ab51ee0bccf6af3a9d34e467867d8354a">qx::trait::remove_attr&lt;T&gt;::type</a> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aa8e28a6f126c5d8ef8f5f32024b1a97b">type_sql_tmp_1</a>;
<a name="l00083"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#a0e0ab6894935b05edbcb8d61f42260c9">00083</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structqx_1_1trait_1_1remove__smart__ptr.html#abb0830d767ac5f6937e7da8e3d036fbd">qx::trait::remove_smart_ptr&lt;type_sql_tmp_1&gt;::type</a> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#a0e0ab6894935b05edbcb8d61f42260c9">type_sql_tmp_2</a>;
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="keyword">public</span>:
<a name="l00086"></a>00086 
<a name="l00087"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">00087</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#a0e0ab6894935b05edbcb8d61f42260c9">qx::QxSqlQueryBuilder&lt;T&gt;::type_sql_tmp_2</a> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">type_sql</a>;
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <span class="keyword">public</span>:
<a name="l00090"></a>00090 
<a name="l00091"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#a918f6375b68098c6ab3d7749bff0e61c">00091</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder.html#a918f6375b68098c6ab3d7749bff0e61c">QxSqlQueryBuilder</a>() : <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a>() { ; }
<a name="l00092"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#ae5478feea656cd91fc7b387f752d420f">00092</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#ae5478feea656cd91fc7b387f752d420f">~QxSqlQueryBuilder</a>() { BOOST_STATIC_ASSERT(<a class="code" href="structqx_1_1trait_1_1is__qx__registered.html" title="qx::trait::is_qx_registered&lt;T&gt;::value : return true if T is registered into QxOrm context to provide ...">qx::trait::is_qx_registered&lt;type_sql&gt;::value</a>); }
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="classqx_1_1_qx_sql_query_builder.html#a2dac0a684d41ef245dc56de5132f7b4b">00094</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#a2dac0a684d41ef245dc56de5132f7b4b">init</a>()
<a name="l00095"></a>00095    {
<a name="l00096"></a>00096       <span class="keywordflow">if</span> (<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a23e5160c5056c9138bad397900a06099" title="Class initialisation finished.">m_bInitDone</a>) { <span class="keywordflow">return</span>; }
<a name="l00097"></a>00097       <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae598cd646e4c23698d69f4f00d0fdfc9" title="QxDataMemberX&lt;type_sql&gt; singleton reference.">m_pDataMemberX</a> = <a class="code" href="classqx_1_1_qx_class.html" title="qx::QxClass&lt;T&gt; : concrete class of type T registered into QxOrm context (this class is a singleton an...">QxClass&lt;type_sql&gt;::getSingleton</a>()-&gt;<a class="code" href="classqx_1_1_qx_class.html#a2be3ca447d8368717bfa63aef795a64c">dataMemberX</a>();
<a name="l00098"></a>00098       <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a> = <a class="code" href="classqx_1_1_qx_class.html" title="qx::QxClass&lt;T&gt; : concrete class of type T registered into QxOrm context (this class is a singleton an...">QxClass&lt;type_sql&gt;::getSingleton</a>()-&gt;<a class="code" href="classqx_1_1_ix_class.html#ae4d37aa15faf1e8f5a779de1b60cec48">getSoftDelete</a>();
<a name="l00099"></a>00099       <a class="code" href="classqx_1_1_qx_sql_query_builder.html#a2dac0a684d41ef245dc56de5132f7b4b">IxSqlQueryBuilder::init</a>();
<a name="l00100"></a>00100    }
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103 
<a name="l00108"></a>00108 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00109"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html">00109</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html" title="qx::QxSqlQueryBuilder_Count&lt;T&gt; : concrete SQL query builder for class T to build a COUNT SQL query...">QxSqlQueryBuilder_Count</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="keyword">public</span>:
<a name="l00113"></a>00113 
<a name="l00114"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#ab46912078502293a460f5b31f1eab7e8">00114</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#ab46912078502293a460f5b31f1eab7e8">type_sql</a>;
<a name="l00115"></a>00115 
<a name="l00116"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#a9e157f4ed2f06382c93b70763943019b">00116</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#a9e157f4ed2f06382c93b70763943019b">QxSqlQueryBuilder_Count</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00117"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#abc02b6c0d5847edf1c524b752e844a93">00117</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#abc02b6c0d5847edf1c524b752e844a93">~QxSqlQueryBuilder_Count</a>() { ; }
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#ad145e2852ce772348e20503b66e07878">00119</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___count.html#ad145e2852ce772348e20503b66e07878">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00120"></a>00120    {
<a name="l00121"></a>00121       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00122"></a>00122       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;Count&quot;</span>)
<a name="l00123"></a>00123       sql = <span class="stringliteral">&quot;SELECT COUNT(*) FROM &quot;</span> + <a class="code" href="classqx_1_1_ix_data_member.html#af452d68c0363b185dbf94d34fee98e2c">qx::IxDataMember::getSqlFromTable</a>(this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a00e1718be72aee31eb6480f0ac59a88e" title="Sql table name of current object.">m_sTableName</a>);
<a name="l00124"></a>00124       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>.<a class="code" href="classqx_1_1_qx_soft_delete.html#a217c44a367c086bc8875f696cc6a563a">isEmpty</a>()) { sql += <span class="stringliteral">&quot; WHERE &quot;</span> + this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>.<a class="code" href="classqx_1_1_qx_soft_delete.html#acfe4afc28ace99a33a774447a73e81c7">buildSqlQueryToFetch</a>(); }
<a name="l00125"></a>00125       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00126"></a>00126       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00127"></a>00127    }
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 };
<a name="l00130"></a>00130 
<a name="l00135"></a>00135 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00136"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html">00136</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html" title="qx::QxSqlQueryBuilder_Exist&lt;T&gt; : concrete SQL query builder for class T to build an EXIST SQL query...">QxSqlQueryBuilder_Exist</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00137"></a>00137 {
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 <span class="keyword">public</span>:
<a name="l00140"></a>00140 
<a name="l00141"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a08fdf579ab1f4770f602a58cca07eb81">00141</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a08fdf579ab1f4770f602a58cca07eb81">type_sql</a>;
<a name="l00142"></a>00142 
<a name="l00143"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a2fec423936fa4c5ab7c2478448277d91">00143</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a2fec423936fa4c5ab7c2478448277d91">QxSqlQueryBuilder_Exist</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00144"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a078fb25fd912a67c801e0c0e15dd6ebe">00144</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#a078fb25fd912a67c801e0c0e15dd6ebe">~QxSqlQueryBuilder_Exist</a>() { ; }
<a name="l00145"></a>00145 
<a name="l00146"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#ad29aed8e360acbb81f7c09f36835702c">00146</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___exist.html#ad29aed8e360acbb81f7c09f36835702c">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00147"></a>00147    {
<a name="l00148"></a>00148       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00149"></a>00149       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;Exist&quot;</span>)
<a name="l00150"></a>00150       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00151"></a>00151       qx::dao::detail::QxSqlQueryHelper_Exist&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>));
<a name="l00152"></a>00152       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00153"></a>00153       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00154"></a>00154    }
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 };
<a name="l00157"></a>00157 
<a name="l00162"></a>00162 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00163"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html">00163</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html" title="qx::QxSqlQueryBuilder_FetchAll&lt;T&gt; : concrete SQL query builder for class T to build a FETCH ALL SQL q...">QxSqlQueryBuilder_FetchAll</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="keyword">public</span>:
<a name="l00167"></a>00167 
<a name="l00168"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a6bcb3c2dee603f3acac55faba2489d7a">00168</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a6bcb3c2dee603f3acac55faba2489d7a">type_sql</a>;
<a name="l00169"></a>00169 
<a name="l00170"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a9a067853fd194ca630512f3c2c29a689">00170</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a9a067853fd194ca630512f3c2c29a689">QxSqlQueryBuilder_FetchAll</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00171"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a1fefad01a259cd648879bc1edd7d5206">00171</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a1fefad01a259cd648879bc1edd7d5206">~QxSqlQueryBuilder_FetchAll</a>() { ; }
<a name="l00172"></a>00172 
<a name="l00173"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a1554128c8c9c947066c2afbe21e63c83">00173</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html#a1554128c8c9c947066c2afbe21e63c83">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00174"></a>00174    {
<a name="l00175"></a>00175       Q_UNUSED(pRelationX);
<a name="l00176"></a>00176 
<a name="l00177"></a>00177       <span class="keywordflow">if</span> ((columns.count() &lt;= 0) || (columns.at(0) == <span class="stringliteral">&quot;*&quot;</span>))
<a name="l00178"></a>00178       {
<a name="l00179"></a>00179          <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;FetchAll&quot;</span>)
<a name="l00180"></a>00180          qx::dao::detail::QxSqlQueryHelper_FetchAll&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>));
<a name="l00181"></a>00181          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00182"></a>00182       }
<a name="l00183"></a>00183       <span class="keywordflow">else</span>
<a name="l00184"></a>00184       {
<a name="l00185"></a>00185          QString sql;
<a name="l00186"></a>00186          <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2815ed56c1bd4ee02a77fb1321970474">verifyColumns</a>(columns)) { <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00187"></a>00187          qx::dao::detail::QxSqlQueryHelper_FetchAll&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>), columns);
<a name="l00188"></a>00188          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql);
<a name="l00189"></a>00189       }
<a name="l00190"></a>00190 
<a name="l00191"></a>00191       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00192"></a>00192    }
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 };
<a name="l00195"></a>00195 
<a name="l00200"></a>00200 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00201"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html">00201</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html" title="qx::QxSqlQueryBuilder_FetchById&lt;T&gt; : concrete SQL query builder for class T to build a FETCH BY ID SQ...">QxSqlQueryBuilder_FetchById</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00202"></a>00202 {
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 <span class="keyword">public</span>:
<a name="l00205"></a>00205 
<a name="l00206"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#a433b86b650392b0642cbe8de215aeedf">00206</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#a433b86b650392b0642cbe8de215aeedf">type_sql</a>;
<a name="l00207"></a>00207 
<a name="l00208"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#a5345e88b66f9608d41673e6485d15493">00208</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#a5345e88b66f9608d41673e6485d15493">QxSqlQueryBuilder_FetchById</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00209"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#af2cede5c4a54dc08a913ec578922c25f">00209</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#af2cede5c4a54dc08a913ec578922c25f">~QxSqlQueryBuilder_FetchById</a>() { ; }
<a name="l00210"></a>00210 
<a name="l00211"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#aadd2a87c0d3416de90c11b6e518741db">00211</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id.html#aadd2a87c0d3416de90c11b6e518741db">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00212"></a>00212    {
<a name="l00213"></a>00213       Q_UNUSED(pRelationX);
<a name="l00214"></a>00214       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00215"></a>00215       <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all.html" title="qx::QxSqlQueryBuilder_FetchAll&lt;T&gt; : concrete SQL query builder for class T to build a FETCH ALL SQL q...">QxSqlQueryBuilder_FetchAll&lt;type_sql&gt;</a> builder; builder.<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a986662b64d6c1ff6fda26a9884d5ef73">clone</a>(* <span class="keyword">this</span>);
<a name="l00216"></a>00216 
<a name="l00217"></a>00217       <span class="keywordflow">if</span> ((columns.count() &lt;= 0) || (columns.at(0) == <span class="stringliteral">&quot;*&quot;</span>))
<a name="l00218"></a>00218       {
<a name="l00219"></a>00219          <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;FetchById&quot;</span>)
<a name="l00220"></a>00220          qx::dao::detail::QxSqlQueryHelper_FetchById&lt;type_sql&gt;::sql(sql, builder);
<a name="l00221"></a>00221          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00222"></a>00222       }
<a name="l00223"></a>00223       <span class="keywordflow">else</span>
<a name="l00224"></a>00224       {
<a name="l00225"></a>00225          QString sql;
<a name="l00226"></a>00226          <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2815ed56c1bd4ee02a77fb1321970474">verifyColumns</a>(columns)) { <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00227"></a>00227          qx::dao::detail::QxSqlQueryHelper_FetchById&lt;type_sql&gt;::sql(sql, builder, columns);
<a name="l00228"></a>00228          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql);
<a name="l00229"></a>00229       }
<a name="l00230"></a>00230 
<a name="l00231"></a>00231       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00232"></a>00232    }
<a name="l00233"></a>00233 
<a name="l00234"></a>00234 };
<a name="l00235"></a>00235 
<a name="l00240"></a>00240 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00241"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html">00241</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html" title="qx::QxSqlQueryBuilder_Insert&lt;T&gt; : concrete SQL query builder for class T to build an INSERT SQL query...">QxSqlQueryBuilder_Insert</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00242"></a>00242 {
<a name="l00243"></a>00243 
<a name="l00244"></a>00244 <span class="keyword">public</span>:
<a name="l00245"></a>00245 
<a name="l00246"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#aee93ee75f4e91fe466d028d93dc8efec">00246</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#aee93ee75f4e91fe466d028d93dc8efec">type_sql</a>;
<a name="l00247"></a>00247 
<a name="l00248"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#a14b18dc11d889878320110cdb83f3fa0">00248</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#a14b18dc11d889878320110cdb83f3fa0">QxSqlQueryBuilder_Insert</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00249"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#a15917219893d763df0f7da799c86c839">00249</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#a15917219893d763df0f7da799c86c839">~QxSqlQueryBuilder_Insert</a>() { ; }
<a name="l00250"></a>00250 
<a name="l00251"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#ae2937d4bfc89d0fad3cd7aba9ed27dad">00251</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___insert.html#ae2937d4bfc89d0fad3cd7aba9ed27dad">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00252"></a>00252    {
<a name="l00253"></a>00253       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00254"></a>00254       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;Insert&quot;</span>)
<a name="l00255"></a>00255       qx::dao::detail::QxSqlQueryHelper_Insert&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>));
<a name="l00256"></a>00256       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00257"></a>00257       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00258"></a>00258    }
<a name="l00259"></a>00259 
<a name="l00260"></a>00260 };
<a name="l00261"></a>00261 
<a name="l00266"></a>00266 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00267"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html">00267</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html" title="qx::QxSqlQueryBuilder_Update&lt;T&gt; : concrete SQL query builder for class T to build an UPDATE SQL query...">QxSqlQueryBuilder_Update</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00268"></a>00268 {
<a name="l00269"></a>00269 
<a name="l00270"></a>00270 <span class="keyword">public</span>:
<a name="l00271"></a>00271 
<a name="l00272"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a7ba510f7e2f4e2b0eaa375b2c0f71875">00272</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a7ba510f7e2f4e2b0eaa375b2c0f71875">type_sql</a>;
<a name="l00273"></a>00273 
<a name="l00274"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a025aed1343beff076325be6fad77da19">00274</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a025aed1343beff076325be6fad77da19">QxSqlQueryBuilder_Update</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00275"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a7a484342617e0f243695d0dbef7bfca5">00275</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a7a484342617e0f243695d0dbef7bfca5">~QxSqlQueryBuilder_Update</a>() { ; }
<a name="l00276"></a>00276 
<a name="l00277"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a39dfaaff43e18cbecca953f3836d380d">00277</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___update.html#a39dfaaff43e18cbecca953f3836d380d">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00278"></a>00278    {
<a name="l00279"></a>00279       Q_UNUSED(pRelationX);
<a name="l00280"></a>00280       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00281"></a>00281 
<a name="l00282"></a>00282       <span class="keywordflow">if</span> ((columns.count() &lt;= 0) || (columns.at(0) == <span class="stringliteral">&quot;*&quot;</span>))
<a name="l00283"></a>00283       {
<a name="l00284"></a>00284          <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;Update&quot;</span>)
<a name="l00285"></a>00285          qx::dao::detail::QxSqlQueryHelper_Update&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>));
<a name="l00286"></a>00286          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00287"></a>00287       }
<a name="l00288"></a>00288       <span class="keywordflow">else</span>
<a name="l00289"></a>00289       {
<a name="l00290"></a>00290          QString sql;
<a name="l00291"></a>00291          <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2815ed56c1bd4ee02a77fb1321970474">verifyColumns</a>(columns)) { <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00292"></a>00292          qx::dao::detail::QxSqlQueryHelper_Update&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>), columns);
<a name="l00293"></a>00293          this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql);
<a name="l00294"></a>00294       }
<a name="l00295"></a>00295 
<a name="l00296"></a>00296       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00297"></a>00297    }
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 };
<a name="l00300"></a>00300 
<a name="l00305"></a>00305 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00306"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html">00306</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html" title="qx::QxSqlQueryBuilder_DeleteAll&lt;T&gt; : concrete SQL query builder for class T to build a DELETE ALL SQL...">QxSqlQueryBuilder_DeleteAll</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308 
<a name="l00309"></a>00309 <span class="keyword">public</span>:
<a name="l00310"></a>00310 
<a name="l00311"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#a639bf29fd254332ae82be754c6e59fba">00311</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#a639bf29fd254332ae82be754c6e59fba">type_sql</a>;
<a name="l00312"></a>00312 
<a name="l00313"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#a3a3b20ec13b55025512b3213fb8182c4">00313</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#a3a3b20ec13b55025512b3213fb8182c4">QxSqlQueryBuilder_DeleteAll</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00314"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#aa8c58e616b15c354dc1a29f258680f51">00314</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#aa8c58e616b15c354dc1a29f258680f51">~QxSqlQueryBuilder_DeleteAll</a>() { ; }
<a name="l00315"></a>00315 
<a name="l00316"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#abfab1667af4365af800e3aa1ee08a50d">00316</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_all.html#abfab1667af4365af800e3aa1ee08a50d">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00317"></a>00317    {
<a name="l00318"></a>00318       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00319"></a>00319       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;DeleteAll&quot;</span>)
<a name="l00320"></a>00320       sql = <span class="stringliteral">&quot;DELETE FROM &quot;</span> + this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a00e1718be72aee31eb6480f0ac59a88e" title="Sql table name of current object.">m_sTableName</a>;
<a name="l00321"></a>00321       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00322"></a>00322       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00323"></a>00323    }
<a name="l00324"></a>00324 
<a name="l00325"></a>00325 };
<a name="l00326"></a>00326 
<a name="l00331"></a>00331 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00332"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html">00332</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html" title="qx::QxSqlQueryBuilder_SoftDeleteAll&lt;T&gt; : concrete SQL query builder for class T to build a SOFT DELET...">QxSqlQueryBuilder_SoftDeleteAll</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00333"></a>00333 {
<a name="l00334"></a>00334 
<a name="l00335"></a>00335 <span class="keyword">public</span>:
<a name="l00336"></a>00336 
<a name="l00337"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#a02e90de9a7e7fdd573ad82fe2b1f4626">00337</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#a02e90de9a7e7fdd573ad82fe2b1f4626">type_sql</a>;
<a name="l00338"></a>00338 
<a name="l00339"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#a52df5f4b483d60b2f876b785eb2321e3">00339</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#a52df5f4b483d60b2f876b785eb2321e3">QxSqlQueryBuilder_SoftDeleteAll</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00340"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#afb15223931e8ec6568c4d9947fead141">00340</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#afb15223931e8ec6568c4d9947fead141">~QxSqlQueryBuilder_SoftDeleteAll</a>() { ; }
<a name="l00341"></a>00341 
<a name="l00342"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#afbed8053d08162a452d602a74f13adb7">00342</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_all.html#afbed8053d08162a452d602a74f13adb7">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00343"></a>00343    {
<a name="l00344"></a>00344       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00345"></a>00345       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;SoftDeleteAll&quot;</span>)
<a name="l00346"></a>00346       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>.<a class="code" href="classqx_1_1_qx_soft_delete.html#a217c44a367c086bc8875f696cc6a563a">isEmpty</a>()) { sql = <span class="stringliteral">&quot;UPDATE &quot;</span> + this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a00e1718be72aee31eb6480f0ac59a88e" title="Sql table name of current object.">m_sTableName</a> + <span class="stringliteral">&quot; SET &quot;</span> + this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>.<a class="code" href="classqx_1_1_qx_soft_delete.html#a5a25cd00c63711bbcd6638bca97040c3">buildSqlQueryToUpdate</a>(); }
<a name="l00347"></a>00347       <span class="keywordflow">else</span> { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); }
<a name="l00348"></a>00348       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00349"></a>00349       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00350"></a>00350    }
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 };
<a name="l00353"></a>00353 
<a name="l00358"></a>00358 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00359"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html">00359</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html" title="qx::QxSqlQueryBuilder_DeleteById&lt;T&gt; : concrete SQL query builder for class T to build a DELETE BY ID ...">QxSqlQueryBuilder_DeleteById</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00360"></a>00360 {
<a name="l00361"></a>00361 
<a name="l00362"></a>00362 <span class="keyword">public</span>:
<a name="l00363"></a>00363 
<a name="l00364"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a3dc65a4d1881fb4612eef9dfcf9c8dd4">00364</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a3dc65a4d1881fb4612eef9dfcf9c8dd4">type_sql</a>;
<a name="l00365"></a>00365 
<a name="l00366"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#adb8b47a791c60552bfc19426e2d77d66">00366</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#adb8b47a791c60552bfc19426e2d77d66">QxSqlQueryBuilder_DeleteById</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00367"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a76878f35dd240e26204f35e3b1e5f822">00367</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a76878f35dd240e26204f35e3b1e5f822">~QxSqlQueryBuilder_DeleteById</a>() { ; }
<a name="l00368"></a>00368 
<a name="l00369"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a1ffd27561340bfd32723bbf56645458f">00369</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___delete_by_id.html#a1ffd27561340bfd32723bbf56645458f">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00370"></a>00370    {
<a name="l00371"></a>00371       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00372"></a>00372       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;DeleteById&quot;</span>)
<a name="l00373"></a>00373       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00374"></a>00374       qx::dao::detail::QxSqlQueryHelper_DeleteById&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>), <span class="keyword">false</span>);
<a name="l00375"></a>00375       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00376"></a>00376       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00377"></a>00377    }
<a name="l00378"></a>00378 
<a name="l00379"></a>00379 };
<a name="l00380"></a>00380 
<a name="l00385"></a>00385 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00386"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html">00386</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html" title="qx::QxSqlQueryBuilder_SoftDeleteById&lt;T&gt; : concrete SQL query builder for class T to build a SOFT DELE...">QxSqlQueryBuilder_SoftDeleteById</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00387"></a>00387 {
<a name="l00388"></a>00388 
<a name="l00389"></a>00389 <span class="keyword">public</span>:
<a name="l00390"></a>00390 
<a name="l00391"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#a64b1237fadaf02f44cc8dff7e1acc0d3">00391</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#a64b1237fadaf02f44cc8dff7e1acc0d3">type_sql</a>;
<a name="l00392"></a>00392 
<a name="l00393"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#ab115515cdc3bd311f69b236ddcb94583">00393</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#ab115515cdc3bd311f69b236ddcb94583">QxSqlQueryBuilder_SoftDeleteById</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00394"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#a8850687a31c0b124f0deb5ae9760f8be">00394</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#a8850687a31c0b124f0deb5ae9760f8be">~QxSqlQueryBuilder_SoftDeleteById</a>() { ; }
<a name="l00395"></a>00395 
<a name="l00396"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#ae4f6d532a25e3c74eeb08765bba564c7">00396</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___soft_delete_by_id.html#ae4f6d532a25e3c74eeb08765bba564c7">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00397"></a>00397    {
<a name="l00398"></a>00398       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00399"></a>00399       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;SoftDeleteById&quot;</span>)
<a name="l00400"></a>00400       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00401"></a>00401       <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>.<a class="code" href="classqx_1_1_qx_soft_delete.html#a217c44a367c086bc8875f696cc6a563a">isEmpty</a>()) { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00402"></a>00402       qx::dao::detail::QxSqlQueryHelper_DeleteById&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>), <span class="keyword">true</span>);
<a name="l00403"></a>00403       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00404"></a>00404       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00405"></a>00405    }
<a name="l00406"></a>00406 
<a name="l00407"></a>00407 };
<a name="l00408"></a>00408 
<a name="l00413"></a>00413 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00414"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html">00414</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html" title="qx::QxSqlQueryBuilder_CreateTable&lt;T&gt; : concrete SQL query builder for class T to build a CREATE TABLE...">QxSqlQueryBuilder_CreateTable</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00415"></a>00415 {
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 <span class="keyword">public</span>:
<a name="l00418"></a>00418 
<a name="l00419"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#aa2c3c3b39d8a8a4a1b2eb6f4fcfd08b9">00419</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#aa2c3c3b39d8a8a4a1b2eb6f4fcfd08b9">type_sql</a>;
<a name="l00420"></a>00420 
<a name="l00421"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#adfd26a26d8c038b41097cfe00845b79a">00421</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#adfd26a26d8c038b41097cfe00845b79a">QxSqlQueryBuilder_CreateTable</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00422"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#a96235aa5e1edacd5addcb3b5b7c5e6bf">00422</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#a96235aa5e1edacd5addcb3b5b7c5e6bf">~QxSqlQueryBuilder_CreateTable</a>() { ; }
<a name="l00423"></a>00423 
<a name="l00424"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#af706377fcebd70a390fbd7eb1b399a38">00424</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___create_table.html#af706377fcebd70a390fbd7eb1b399a38">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00425"></a>00425    {
<a name="l00426"></a>00426       Q_UNUSED(columns); Q_UNUSED(pRelationX);
<a name="l00427"></a>00427       <a class="code" href="_qx_sql_query_builder_8h.html#a001bf522404d48bd3436036707a4e687">QX_SQL_BUILDER_INIT_FCT</a>(<span class="stringliteral">&quot;CreateTable&quot;</span>)
<a name="l00428"></a>00428       qx::dao::detail::QxSqlQueryHelper_CreateTable&lt;type_sql&gt;::sql(sql, (* <span class="keyword">this</span>));
<a name="l00429"></a>00429       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00430"></a>00430       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00431"></a>00431    }
<a name="l00432"></a>00432 
<a name="l00433"></a>00433 };
<a name="l00434"></a>00434 
<a name="l00439"></a>00439 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00440"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html">00440</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html" title="qx::QxSqlQueryBuilder_FetchAll_WithRelation&lt;T&gt; : concrete SQL query builder for class T to build a FE...">QxSqlQueryBuilder_FetchAll_WithRelation</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00441"></a>00441 {
<a name="l00442"></a>00442 
<a name="l00443"></a>00443 <span class="keyword">public</span>:
<a name="l00444"></a>00444 
<a name="l00445"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#aafaf4af62df23592c3668ea9f1f0810d">00445</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#aafaf4af62df23592c3668ea9f1f0810d">type_sql</a>;
<a name="l00446"></a>00446 
<a name="l00447"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a4be5d4694c435fac272bbf4983611018">00447</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a4be5d4694c435fac272bbf4983611018">QxSqlQueryBuilder_FetchAll_WithRelation</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00448"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a534aaece770aa5cf761a2c3a88cb9672">00448</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a534aaece770aa5cf761a2c3a88cb9672">~QxSqlQueryBuilder_FetchAll_WithRelation</a>() { ; }
<a name="l00449"></a>00449 
<a name="l00450"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a08a908a531e451f876543bcb8ee1f3dc">00450</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html#a08a908a531e451f876543bcb8ee1f3dc">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00451"></a>00451    {
<a name="l00452"></a>00452       Q_UNUSED(columns);
<a name="l00453"></a>00453       <a class="code" href="_qx_sql_query_builder_8h.html#a0842b161dcbe9aa9604465550c33602f">QX_SQL_BUILDER_INIT_FCT_WITH_RELATION</a>(<span class="stringliteral">&quot;FetchAll_WithRelation&quot;</span>)
<a name="l00454"></a>00454       qx::dao::detail::QxSqlQueryHelper_FetchAll_WithRelation&lt;type_sql&gt;::sql(pRelationX, sql, (* <span class="keyword">this</span>));
<a name="l00455"></a>00455       <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a8c26bdd59fe34add5a72a6113489a11e" title="Store here all SQL aliases generated by child classes.">IxSqlQueryBuilder::m_lstSqlAlias</a>.insert(key, this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a1a3ae000bff62ae36085e0d945dd0d0e" title="List of sql alias to replace into sql query.">m_lstSqlQueryAlias</a>);
<a name="l00456"></a>00456       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00457"></a>00457       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00458"></a>00458    }
<a name="l00459"></a>00459 
<a name="l00460"></a>00460 };
<a name="l00461"></a>00461 
<a name="l00466"></a>00466 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00467"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html">00467</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html" title="qx::QxSqlQueryBuilder_FetchById_WithRelation&lt;T&gt; : concrete SQL query builder for class T to build a F...">QxSqlQueryBuilder_FetchById_WithRelation</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;
<a name="l00468"></a>00468 {
<a name="l00469"></a>00469 
<a name="l00470"></a>00470 <span class="keyword">public</span>:
<a name="l00471"></a>00471 
<a name="l00472"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#a9e12f0fa14efca86f010fb126c1ec8a4">00472</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_query_builder.html#aadcab843c24b5fae8d09d6ae4c0ab7d8">QxSqlQueryBuilder&lt;T&gt;::type_sql</a> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#a9e12f0fa14efca86f010fb126c1ec8a4">type_sql</a>;
<a name="l00473"></a>00473 
<a name="l00474"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#afdbf1318d1d836b5bd9041bdf3f2efc4">00474</a>    <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#afdbf1318d1d836b5bd9041bdf3f2efc4">QxSqlQueryBuilder_FetchById_WithRelation</a>() : <a class="code" href="classqx_1_1_qx_sql_query_builder.html" title="qx::QxSqlQueryBuilder&lt;T&gt; : concrete SQL query builder for class T with a cache mechanism to backup an...">QxSqlQueryBuilder</a>&lt;T&gt;() { ; }
<a name="l00475"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#a1868ef3f726a8d6ab40616d30e216164">00475</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#a1868ef3f726a8d6ab40616d30e216164">~QxSqlQueryBuilder_FetchById_WithRelation</a>() { ; }
<a name="l00476"></a>00476 
<a name="l00477"></a><a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#ae808c7dfe9a5070d9138745d1366793e">00477</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_by_id___with_relation.html#ae808c7dfe9a5070d9138745d1366793e">buildSql</a>(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL)
<a name="l00478"></a>00478    {
<a name="l00479"></a>00479       Q_UNUSED(columns);
<a name="l00480"></a>00480       <a class="code" href="_qx_sql_query_builder_8h.html#a0842b161dcbe9aa9604465550c33602f">QX_SQL_BUILDER_INIT_FCT_WITH_RELATION</a>(<span class="stringliteral">&quot;FetchById_WithRelation&quot;</span>)
<a name="l00481"></a>00481       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] %s&quot;</span>, <a class="code" href="_qx_sql_query_builder_8h.html#a786cca79dc5be29fd33e83f4ca125d95">QX_SQL_ERR_NO_ID_REGISTERED</a>); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(<span class="keyword">false</span>); <span class="keywordflow">return</span> (* <span class="keyword">this</span>); }
<a name="l00482"></a>00482       <a class="code" href="classqx_1_1_qx_sql_query_builder___fetch_all___with_relation.html" title="qx::QxSqlQueryBuilder_FetchAll_WithRelation&lt;T&gt; : concrete SQL query builder for class T to build a FE...">QxSqlQueryBuilder_FetchAll_WithRelation&lt;type_sql&gt;</a> builder; builder.<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a986662b64d6c1ff6fda26a9884d5ef73">clone</a>(* <span class="keyword">this</span>);
<a name="l00483"></a>00483       qx::dao::detail::QxSqlQueryHelper_FetchById_WithRelation&lt;type_sql&gt;::sql(pRelationX, sql, builder);
<a name="l00484"></a>00484       <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a8c26bdd59fe34add5a72a6113489a11e" title="Store here all SQL aliases generated by child classes.">IxSqlQueryBuilder::m_lstSqlAlias</a>.insert(key, this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#a1a3ae000bff62ae36085e0d945dd0d0e" title="List of sql alias to replace into sql query.">m_lstSqlQueryAlias</a>);
<a name="l00485"></a>00485       this-&gt;<a class="code" href="classqx_1_1_ix_sql_query_builder.html#acf5a365ef3983e9bf09d22e31862a665">setSqlQuery</a>(sql, key);
<a name="l00486"></a>00486       <span class="keywordflow">return</span> (* <span class="keyword">this</span>);
<a name="l00487"></a>00487    }
<a name="l00488"></a>00488 
<a name="l00489"></a>00489 };
<a name="l00490"></a>00490 
<a name="l00491"></a>00491 } <span class="comment">// namespace qx</span>
<a name="l00492"></a>00492 
<a name="l00493"></a>00493 <span class="preprocessor">#endif // _QX_SQL_QUERY_BUILDER_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_qx_sql_query_builder_8h.html">QxSqlQueryBuilder.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:04 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
